<template>
	<view>
		<uni-title type="h1" align="center" :title="rule.title"></uni-title>
		
		<uni-section :title="time">
			<template v-slot:right>
				<uni-icons type="eye" style="margin-right: 10rpx;"></uni-icons>  {{view}}
			</template>
		</uni-section>
		
		<view style="padding:20rpx;">
			<rich-text :nodes="rule.content"/>
		</view>
		
	</view>
</template>

<script>
	import knowledge from '@/api/modules/knowledge';
	
	export default {
		data() {
			return {
				rule : {},
				view : 0, //阅读量
				time : '', //发布时间
			}
		},
		onLoad(options) {
			if ('id' in options) {
				knowledge.getRuleRegulationById(options.id).then(res=> {
					this.rule = res.data;
					this.time = "发布时间："+this.rule.createTime.split(" ")[0];
					knowledge.autoIncrementViewCount(this.rule.id).then(res=> {
						this.view = res.data;
					})
				})
				
			}
		},
		methods: {
			
		}
	}
</script>

<style>

</style>
